New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8276663: Cleanup NMT AccessLock #6267
Conversation
👋 Welcome back zgu! A progress list of the required criteria for merging this PR into |
@zhengyu123 The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
Hi Zhengyu, I do not understand this change. The "counter" is what makes the lock acts as a lock. Locks generally require acquire/release semantics wrt. to the locking and unlocking around a critical section. So how can you switch to use mo_relaxed? David |
To clarify a writeLock needs acquire on lock and release on unlock; the readLock only needs acquire on lock. |
+1. We cannot do this relaxation here, unless we also add explicit fences. I think the best we can do here is to "relax" |
Right, I am embarrassed. This is a lock, does have memory semantics. Thanks, -Zhengyu |
I'm trying to reason about this but am struggling to understand how this "lock" is actually used. It isn't really a lock at all but a kind of access-latch: anyone can access things in normal operation but when we want to shutdown then we basically put up a closed sign, wait for all current users to leave and then do a reset. There are no critical sections as such and no related memory operations that this "lock" is guarding. So maybe it doesn't need any memory ordering after all. ?? |
It has been a long time. I reread the code. Yes, it is a kind of count-down-latch, which allows read-only walk to complete before list can be destroyed. Now, I suspect that AccessLock is not sufficient, cause it does not guard against insertion. I would like to withdraw this PR for now. |
Please review this cleanup patch to NMT AccessLock:
Test:
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6267/head:pull/6267
$ git checkout pull/6267
Update a local copy of the PR:
$ git checkout pull/6267
$ git pull https://git.openjdk.java.net/jdk pull/6267/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6267
View PR using the GUI difftool:
$ git pr show -t 6267
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6267.diff